import {reactive} from "vue";

export default function useDialog() {

    const dialog = reactive({
        title: '提示',
        width: 600,
        height: 270,
        visible: false
    })
    const onClose = () => {
        dialog.visible = false;
    }
    const onConfirm = () => {
        dialog.visible = true
    }
    const onShow = () => {
        dialog.visible = true
    }

    return {
        dialog,
        onClose,
        onConfirm,
        onShow
    }
}
/**
 * ref定义简单 基础的数据类型的响应式数据
 * reactive 接受复杂类型的响应式数据
 */